package com.yx.coredata.nettySocketIo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * desc:  <br>
 * date: 2018/12/27 0027
 *
 * @author Administrator
 */
@Controller
@RequestMapping("/server")
public class SocketController {

    @Autowired
    private EventListennter eventListennter;

    @RequestMapping("/send")
    public void sendMsg() {
        System.err.println("send Msg....");
        eventListennter.sendAllUser();
    }

    @RequestMapping("/sendOne")
    public void sendOne(long userId) {
        System.err.println("send Msg....");
        SocketIOMessage socketIOMessage = new SocketIOMessage();
        socketIOMessage.setMessage("nima");
        socketIOMessage.setTo("111");
        eventListennter.sendOne(userId,socketIOMessage);
    }

}